//
//  Shapes.swift
//  learn-ios
//
//  Created by Dong on 2022/4/5.
//

import ManagedSettings
import SwiftUI

struct Shapes: View {
    var body: some View {
        ScrollView {
            VStack {
                // 矩形
                Rectangle()
                    .foregroundColor(.blue)
                    .frame(width: 200, height: 200, alignment: .top)

                // 圆角矩形
                RoundedRectangle(cornerRadius: 20)
                    .foregroundColor(.brown)
                    .frame(width: 200, height: 200, alignment: .top)

                // 圆
                Circle()
                    .foregroundColor(.yellow)
                    .frame(width: 200, height: 100, alignment: .top)

                // 椭圆
                Ellipse()
                    .frame(width: 200, height: 100, alignment: .top)

                // 两边对齐圆
                Capsule()
                    .frame(width: 200, height: 100, alignment: .top)
            }
        }
    }
}

struct Shapes_Previews: PreviewProvider {
    static var previews: some View {
        Shapes()
    }
}
